package jmine.tec.scheduling.services.excluir;

import jmine.tec.scheduling.domain.ScheduledTask;
import jmine.tec.services.annotations.Execution;
import jmine.tec.services.annotations.Input;
import jmine.tec.services.annotations.ServiceImplementor;
import jmine.tec.services.api.ActionsEnum;

/**
 * Excludes a scheduled task
 * 
 * @author ricardo.abe
 */
@ServiceImplementor(action = ActionsEnum.EXCLUIR)
public class ScheduledTaskService {
    public static final String TASK = "Task";

    private ScheduledTask task;

    /**
     * Excludes a scheduled task
     */
    @Execution
    public void execute() {
        this.task.getPersister().remove();
    }

    /**
     * @param task the task to set
     */
    @Input(fieldName = TASK)
    public void setTask(ScheduledTask task) {
        this.task = task;
    }
}
